Avoid crashes when X fonts are erroneously freed on reused X
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 3 Mar 2014 08:27:58 +0000 (12:27 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Mon, 3 Mar 2014 08:27:58 +0000 (12:27 +0400)
commite3ec544d00b135112a1d72fe1ee5f71045259a34
treeb177d044f42e12a7ba5d0909caa843fc60d71720
parentb0c9db815fbe2b37024c5779066e2d612c8759a7
Avoid crashes when X fonts are erroneously freed on reused X
'Display *' connection data (Bug#16069).  Note that X font
resources still may be leaked, but currently there is no way
to completely avoid it.
* xterm.h (struct x_display_info): New member x_id.  Add comments.
* xterm.c (x_display_id): New variable.
(x_term_init): Assign identifier to each opened X connection.
* xfont.c (struct xfont): New member x_display_id.
(xfont_open): Initialize it with frame's display id.
(xfont_close): Check whether font's display id matches the one
recorded for the given display.  Adjust comment.
* xftfont.c (struct xftfont_info):
(xftfont_open, xftfont_close): Exactly as above with xfont stuff.
src/ChangeLog
src/xfont.c
src/xftfont.c
src/xterm.c
src/xterm.h